package mua.core.operation.judge;

import mua.core.value.*;

public class Judge {
    public static MuaValue isNumber(MuaValue a){
        return new Bool(String.valueOf(a instanceof mua.core.value.Number));
    }

    public static MuaValue isWord(MuaValue a){
        return new Bool(String.valueOf(a instanceof Word));
    }

    public static MuaValue isList(MuaValue a){
        if(a instanceof List){
            return new Bool("true");
        }
        return new Bool("false");
    }

    public static MuaValue isBool(MuaValue a){
        return new Bool(String.valueOf(a instanceof Bool));
    }

    public static MuaValue isEmpty(MuaValue a){
        if(a instanceof List){
            String s = a.toString();
            s.replace(" ","");
            if(s.charAt(0)=='['&&s.charAt(1)==']'){
                return new Bool("true");
            }
            return new Bool("false");
        }
        //要判断为字的时候
        return new Bool("false");
    }

}
